import { Container } from "@pixi/display";
import { CellNum, MapCellSize } from "../config/game-config";
import { CellType, MapCell } from "./map-cell";

export class MapContainer extends Container {
  constructor() {
    super();
    this.init();
  }

  private init() {
    this.createCell();
  }

  private createCell() {
    for (let i = 0; i < CellNum; i++) {
      for (let j = 0; j < CellNum; j++) {
        const mc = new MapCell();
        mc.init(CellType.grass)
        mc.x = i * MapCellSize;
        mc.y = j * MapCellSize;
        this.addChild(mc);
      }
    }
  }
}
